from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # 点击搜索
    def sou(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索菜谱")')
        ele=self.find_loc(loc)
        return ele
    # 二次点击搜索，输入内容
    def ercisou(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_loc(loc)
        return ele
    # 点击搜索按钮
    def sousuoanniu(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.find_loc(loc)
        return ele
    # 点击图片
    def tupian(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.xiachufang:id/common_photo_image_view"])[1]')
        ele=self.find_loc(loc)
        return ele
    # 上滑
    def shanghua(self):
        self.hua(484,1642,484,597)
    # 收藏
    def shoucang(self):
        loc=(By.ID,'com.xiachufang:id/recipe_bto_nav_bar_collect')
        ele=self.find_loc(loc)
        return ele
    # 轻敲评轮
    def pinglun(self):
        self.qiao(392,1839)
    # 返回
    def fanhui(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().description("返回")')
        ele=self.find_loc(loc)
        return ele
    # 断言 综合
    def duanyan(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="综合"]')
        ele=self.find_loc(loc)
        return ele
    # 断言 这个页面
    def dubo(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/tv_load_status_major"]')
        ele=self.find_loc(loc)
        return ele
